using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using Evolution.Engine.Cameras;
using Microsoft.Xna.Framework;

namespace Evolution.Engine.Managers
{
    public class CameraManager : Singleton<CameraManager>
    {
        private Hashtable _CameraList = new Hashtable();
        private string _Current;

        public Camera ActiveCamera = null;

        public void Add(Camera camera)
        {
            if( !Contains(camera.Name.ToLower()) )
                _CameraList.Add(camera.Name.ToLower(), camera);

            _Current = camera.Name.ToLower();
            ActiveCamera = (Camera)_CameraList[_Current];
        }

        public bool Contains(Camera Camera)
        {
            return Contains(Camera.Name);
        }

        public bool Contains(string name)
        {
            return _CameraList.ContainsKey(name);
        }

        public void SetCamera(string name, CameraType type)
        {
            if (Contains(name.ToLower()))
            {
                _Current = name.ToLower();
                ActiveCamera = (Camera)_CameraList[_Current];
            }
        }
    }
}
